<template>
  <div class="page">
    <div class="scroll-view">
      <customHeader middleTitle="对账单" @leftCallBack="goBack" />
      <div class="page-body">
        <mt-cell title="对账单查询" to="/accountStatement/list" is-link class="mt30"></mt-cell>
        <!-- <mt-cell title="分账对账单查询" to="/accountSplitBillStatement/list" is-link></mt-cell> -->
        <mt-cell title="结算状态查询" to="/settlementStatus" is-link></mt-cell>
        <!-- <mt-cell v-if="auth" title="结算状态查询" to="/settlementStatus" is-link></mt-cell> -->
      </div>
    </div>
  </div>
</template>

<script>
import customHeader from "../../components/header/header";
import jsBridge from "../../tools/jsBridge.js";
import jsAuthority from "../../tools/jsAuthority.js";
export default {
  data() {
    return {
      auth: false,
    };
  },
  components: {
    customHeader
  },
  methods: {
    goBack() {
      if (String(this.$route.query.close) == 'true') {
        jsBridge.closeWindow();
      } else {
        this.$router.back();
      }
    }
  },
  // created() {
  //   jsAuthority.checkedSuccess(() => {
  //     this.auth = jsAuthority.checked(
  //       "app.duizhangdan.jsztQuery"
  //     );
  //   });
  // },
  beforeRouteEnter(to, from, next) {
    jsAuthority.checkedSuccess(() => {
      let flag = jsAuthority.checked(
        "app.duizhangdan.jsztQuery"
      );
      if(flag) {
        next()
      }else {
        next('/accountStatement/list?close=true')
      }
    });
  }
}
</script>

<style lang="scss" scoped>
@import "../../style/public";
.mt30 {
  @include remCalc(margin-top, 30);
}
</style>
